package co.fitstart.entity.market;

public enum CoursewareStatus {
    
    PREPARE("prepare", "未开启"),
    
    SIGNINING("signining", "打卡中"),
    
    FINISHED("finished", "已完成");
    
    private String alias;
    
    private String description;
    
    private CoursewareStatus(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static CoursewareStatus aliasOf(String alias) {
        for (CoursewareStatus coursewareStatus : CoursewareStatus.values()) {
            if (coursewareStatus.getAlias().equalsIgnoreCase(alias)) {
                return coursewareStatus;
            }
        }
        
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isPrepare() {
        return this.equals(PREPARE);
    }
    
    /**
     * 
     * @return
     */
    public boolean isSignining() {
        return this.equals(SIGNINING);
    }
    
    /**
     * 
     * @return
     */
    public boolean isFinished() {
        return this.equals(FINISHED);
    }
    
    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param alias the alias to set
     */
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

}
